<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">计划详情</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">计划编号</th>
                        <td>{$row.plan_no}</td>
                    </tr>
                    <tr>
                        <th>计划名称</th>
                        <td>{$row.plan_name}</td>
                    </tr>
                    <tr>
                        <th>关联订单</th>
                        <td>{$row.order_no}</td>
                    </tr>
                    <tr>
                        <th>客户名称</th>
                        <td>{$row.customer_name}</td>
                    </tr>
                    <tr>
                        <th>计划数量</th>
                        <td>{$row.planned_quantity}</td>
                    </tr>
                </table>
            </div>
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">开始日期</th>
                        <td>{$row.start_date}</td>
                    </tr>
                    <tr>
                        <th>结束日期</th>
                        <td>{$row.end_date}</td>
                    </tr>
                    <tr>
                        <th>优先级</th>
                        <td>
                            {if $row.priority == 1}
                                <span class="label label-info">低</span>
                            {elseif $row.priority == 2}
                                <span class="label label-warning">中</span>
                            {elseif $row.priority == 3}
                                <span class="label label-danger">高</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>状态</th>
                        <td>
                            {if $row.status == 0}
                                <span class="label label-default">草稿</span>
                            {elseif $row.status == 1}
                                <span class="label label-info">已发布</span>
                            {elseif $row.status == 2}
                                <span class="label label-primary">执行中</span>
                            {elseif $row.status == 3}
                                <span class="label label-success">已完成</span>
                            {elseif $row.status == 4}
                                <span class="label label-danger">已取消</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>创建时间</th>
                        <td>{$row.createtime|datetime}</td>
                    </tr>
                </table>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-12">
                <h4>计划明细</h4>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>产品型号</th>
                            <th>工序</th>
                            <th>计划数量</th>
                            <th>状态</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $planDetails as $detail}
                        <tr>
                            <td>{$detail.productModel.product.name} - {$detail.productModel.name}</td>
                            <td>{$detail.process.name}</td>
                            <td>{$detail.planned_quantity}</td>
                            <td>
                                {if $detail.status == 0}
                                    <span class="label label-default">待开始</span>
                                {elseif $detail.status == 1}
                                    <span class="label label-primary">进行中</span>
                                {elseif $detail.status == 2}
                                    <span class="label label-success">已完成</span>
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
        
        {if $row.remark}
        <div class="row">
            <div class="col-md-12">
                <h4>备注</h4>
                <p>{$row.remark}</p>
            </div>
        </div>
        {/if}
    </div>
</div>
